<?
 class lang extends add_module{
  function choose_standby(){   $this->default_lang();   return $this->show_table_lang();
  }

  function choose_schedule(){   return $this->show_table_lang();
  }

  function show_table_lang(){   $tmp=$this->model->return_count_lang();
   if (!empty($tmp) && count($tmp)>=2){
    foreach($tmp as $key=>$value){     if($value['name']==$_SESSION['lang']){     	$ret.=$this->view->view("templates/site/tpl_module/lang/lang_link_!.tpl",$value,true);
      }else{     	$ret.=$this->view->view("templates/site/tpl_module/lang/lang_link.tpl",$value,true);
      }
    }
    $data['lang_link']=$ret;
    $data=$this->view->view("templates/site/tpl_module/lang/lang_form.tpl",$data,true);
    return $data;
    }else{   	 return $data="";
   	}
  }

  function choose($lang){  	$lang=$this->security($lang,2,3);
  	if(empty($lang)){     $this->default_lang();
  	 }else{  	  session_start();
      session_register("lang");
      $_SESSION['lang']=$lang;
     }
  }
  function default_lang(){  	session_start();
    session_register("lang");
    $lang=$this->model->get_info("default_lang","site_info","id","1");
    $_SESSION['lang']=$lang;
  }

  function save_lang(){   if($this->access()){   	$this->test();
   }
  }

  protected function test(){   echo"start";
  }
 }
?>